import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/lazy-page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getAllData = (params) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/lazy-list',
        method: 'get',
        params
    });
};

export const getSelectPage = (current, size, params) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/select-page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getDetail = (params) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/detail',
        method: 'get',
        params
    });
};

export const remove = (ids) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/remove',
        method: 'post',
        params: {
            ids
        }
    });
};

export const add = (row) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/edit',
        method: 'post',
        data: row
    });
};

export const submit = (row) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/submit',
        method: 'post',
        data: row
    });
};

export const update = (row) => {
    return request({
        url: '/api/mes-qms/partcategory/submit',
        method: 'post',
        data: row
    });
};

export const getLazyList = (parentId, current, size, params) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/lazy-page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
            parentId
        }
    });
};

export const getMenuTree = (current, size, params) => {
    return request({
        url: '/api/mes-qms/part-category/tree',
        method: 'get',
        params: {
            current,
            size,
            params
        }
    });
};

export const getPartCategory = (current, size, params) => {
    return request({
        url: '/api/mes-qms/part-category/tree',
        method: 'get',
        params: {
            current,
            size,
            params
        }
    });
};

export const getPartCategoryLazyList = (parentId, current, size, params) => {
    return request({
        url: '/api/mes-qms/partcategory/lazy-list-page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
            parentId
        }
    });
};


export const getAqlConfig = (params) => {
    return request({
        url: '/api/mes-qms/qms-aql-scheme/list',
        method: 'get',
        params
    });
};

export const globalTemplate = (params) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/default/inspection-part',
        method: 'get',
        params
    });
};

export const globalSubmit = (row) => {
    return request({
        url: '/api/mes-qms/qms-inspection-config/default/submit',
        method: 'post',
        data: row
    });
};
